package org.bmi.gwt.examples.clienttr.shared;

import org.bmi.gwt.mi.shared.MiObject;

import com.google.gwt.dom.client.Document;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.RootPanel;

public class Element1Object implements MiObject
{
	private String str;

	public Element1Object()
	{
		this.str = "no args constructor";
	}

	public Element1Object(String str)
	{
		this.str = str;
	}

	public String getString()
	{
		return this.str;
	}

	public Element1Object getCopy()
	{
		return new Element1Object("copy of <" + this.str + ">");
	}

	public void print()
	{
		RootPanel rootPanel = RootPanel.get();
		Element body = rootPanel.getElement();

		body.appendChild(Document.get().createTextNode(this.str));
		body.appendChild(Document.get().createBRElement());
	}
}
